package com.jay.lang.clazz;

import java.util.Date;

public class StringCls {
	public static void main(String[] args) {
		String s1 = "ab";
		String s2 = new String("ab");

		System.out.println(s1 == s2);
		System.out.println(s1.equals(s2));
		s2.intern();
		System.out.println(s1 == s2);
		System.out.println(s1 == s2.intern());

		String a = "a";
		String b = "b";
		String s3 = a + b;

		System.out.println(s1 == s3);
		System.out.println(s1 == s3.intern());

		System.out.println("-------Common Methods--------");
		System.out.println(s1.concat(s3));

		float floatType = 1000.00f;
		double doubleTyep = 11111111111111111.00d;
		Date dateType = new Date();
		String floatStr = String.format("%a,  %e,  %f,  %g", floatType,
				floatType, floatType, floatType);
		String doubleStr = String.format("%a,  %e,  %f,  %g", doubleTyep,
				doubleTyep, doubleTyep, doubleTyep);
		String dataStr = String.format("%1$tm-%1$te-%1$tY", dateType);
		System.out.println(floatStr);
		System.out.println(doubleStr);
		System.out.println(dataStr);
		
		System.out.println(s1.getBytes());
		System.out.println(("\t" + s1 + "   d  ").trim());
		System.out.println(s1.matches("[a-f]{2}"));
		System.out.println("boo:and:foo".split(":"));
		

	}
}
